package com.alfayun.fiscalriskanalysis.javaFunction;

import java.math.BigDecimal;
import java.util.List;
import java.util.function.Function;

public class Sum implements Function<List<BigDecimal>, BigDecimal> {
	
	private BigDecimal result;
	
	@Override
	public BigDecimal apply(List<BigDecimal> params) {
		params.forEach(item -> {
			result = result.add(item);
		});
		return result;
	}

}
